$(function () {
    $.ajaxPrefilter(function (option) {
        //.1简化了url
        option.url = "http://localhost:8080/api/v1" + option.url;
        //2.统一设置请求中携带token
        option.headers = {
            Authorization: localStorage.getItem("token")
        }
        //3.自动显示
        let loadIndex;
        option.beforeSend = function () {
            loadIndex = layer.load()
        }
        option.complete = function () {
            layer.close(loadIndex)
        }
    })
    // $.ajaxPrefilter(function () {
    //     //1简化url
    //     option.url = "http://localhost:8080/api/v1"
    // })
})